import request from '@/utils/request'

// 获取用户收件地址
export const getAddress = params => {
  return request ({
    method: 'GET',
    url: '/address/list',
    params
  })
}
// 获取用户收件地址
export const getOrderConfirm = data => {
  return request ({
    method: 'POST',
    url: '/order/confirm',
    data
  })
}
// 创建订单
export const createOrder = (orderKey, data) => {
  return request ({
    method: 'POST',
    url: `/order/create/${orderKey}`,
    data
  })
}

// 获取订单列表 
export const getOrderList = () => request ({
  method: 'GET',
  url: '/order/list'
})

// 根据 ID 获取订单详情 
export const getOrderDeatil = orderId => request ({
  method: 'GET',
  url: `/order/detail/${orderId}`,
  orderId
})

